/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/


#include "stdafx.h"
#include <pgl/markup/MarkupArchive.h>
#include <pgl/zlib/gzip.h>

#include <pgl/markup/STL2String.h>

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
namespace markup
{

CMarkupArchive::~CMarkupArchive()
{}

bool CMarkupArchive::LoadFile(LPCTSTR szFileName)
{
	using namespace zlib;
	LPCTSTR szString = NULL;
	CGZip gzip;

	// loading buffer...	
	if (!gzip.Open( szFileName, CGZip::ArchiveModeRead) )
		return false;

	gzip.ReadString(&szString);
	gzip.Close();

	bool bSuccess=SetDoc(szString);

	if (szString)
		delete[] (TCHAR*)szString;
	
	return bSuccess;

//	return Load(szFileName);
}

bool CMarkupArchive::LoadString(LPCTSTR szXMLString)
{
	return SetDoc(szXMLString);
}


bool CMarkupArchive::SaveFile(LPCTSTR szFileName)
{
	using namespace zlib;

	if (IsZipping())
	{
		CGZip zipper;
		
		if(!zipper.Open(szFileName, CGZip::ArchiveModeWrite))
			return false;

		if(!zipper.WriteString( GetDoc() ) )
			return false;

		return zipper.Close();
	}
	else
		return Save(szFileName);
}

bool CMarkupArchive::FindElemAttrib( LPCTSTR szName, LPCTSTR szAttrib, LPCTSTR szAttribValue )
{
#ifdef _MARKUP_NO_MARKUP
	return false;
#else
	if ( szName == NULL || !szName[0] || szAttrib == NULL || !szAttrib[0])
		return false;

	// Otherwise go to next sibling element with matching tag name and attrib value
	// If the current position is valid, start looking from next
	// Change current position only if found
	int iPos = m_iPos;
	if ( ! iPos )
	{
		if ( m_aPos.GetSize() )
			iPos = m_aPos[0].iElemChild;
	}
	else
	{
		iPos = m_aPos[iPos].iElemNext;
	}

	BOOL bGotIt;											// --- Added --- TMB! 22-08-2002 ** INSAD **
	while ( iPos )
	{
		// Compare tag name unless szName is not specified
		// --- start --- TMB! 22-08-2002 ** INSAD **
		bGotIt = (x_GetTagName(iPos) == m_sNameSpace+szName);
		if (bGotIt && szAttribValue == NULL) 
		{
			bGotIt = x_GetAttrib(iPos, szAttrib) != "";		// Assume empty value is same as attribute not there...
		}
		else 
		{
			bGotIt = (x_GetAttrib(iPos, szAttrib) == szAttribValue);
		}
		if (bGotIt)
		// --- oldcode --- TMB! 22-08-2002 ** INSAD **
		//if ( x_GetTagName(iPos) == m_sNameSpace+szName && x_GetAttrib(iPos, szAttrib) )
		// --- end --- TMB! 22-08-2002 ** INSAD **
		{
			// Assign new position
			m_iPos = iPos;
			m_iPosChild = 0;
			return true;
		}
		iPos = m_aPos[iPos].iElemNext;
	}
	return false;
#endif
}



bool CMarkupArchive::FindChildElemAttrib( LPCTSTR szName , LPCTSTR szAttrib, LPCTSTR szAttribValue )
{
#ifdef _MARKUP_NO_MARKUP
	return false;
#else
	if ( szName == NULL || !szName[0] || szAttrib == NULL || !szAttrib[0])
		return false;

	// If szName is NULL or empty, go to next sibling child element
	// Otherwise go to next sibling child element with matching tag name
	// If the current child position is valid, start looking from next
	// Change current child position only if found
	//
	// Shorthand: call this with no current position means under root element
	if ( ! m_iPos )
		FindElem();

	// Is main position valid and not empty?
	if ( ! m_iPos || m_aPos[m_iPos].IsEmptyElement() )
		return false;

	// Is current child position valid?
	int iPosChild = m_iPosChild;
	if ( iPosChild )
		iPosChild = m_aPos[iPosChild].iElemNext;
	else
		iPosChild = m_aPos[m_iPos].iElemChild;

	// Search
	BOOL bGotIt;											// --- Added --- TMB! 22-08-2002 ** INSAD **
	while ( iPosChild )
	{
		// Compare tag name unless szName is not specified
		// --- start --- TMB! 22-08-2002 ** INSAD **
		bGotIt = (x_GetTagName(iPosChild) == m_sNameSpace+szName);
		if (bGotIt && szAttribValue == NULL) 
		{
			bGotIt = x_GetAttrib(iPosChild, szAttrib) != _T("");		// Assume empty value is same as attribute not there...
		}
		else 
		{
			bGotIt = (x_GetAttrib(iPosChild, szAttrib) == szAttribValue);
		}
		if (bGotIt)
		// --- oldcode --- TMB! 22-08-2002 ** INSAD **
		//if ((x_GetTagName(iPosChild) == m_sNameSpace+szName) && (x_GetAttrib(iPosChild, szAttrib) == szAttribValue))
		// --- end --- TMB! 22-08-2002 ** INSAD **
		{
			// Assign new position
			m_iPosChild = iPosChild;
			return true;
		}
		iPosChild = m_aPos[iPosChild].iElemNext;
	}
	return false;
#endif
}


///////////////////////////////////////////////////////////////////////////////////////////////////////::
/// GetData functions
///////////////////////////////////////////////////////////////////////////////////////////////////////::
COleDateTimeSpan CMarkupArchive::GetDataDateTimeSpan() const
{
	int d=0,h=0,m=0,s=0; 
	_stscanf(GetData(),_T("%d,%d:%d:%d"),&d,&h,&m,&s);
	return COleDateTimeSpan(d,h,m,s);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////::
/// GetChildData functions
///////////////////////////////////////////////////////////////////////////////////////////////////////::
COleDateTimeSpan CMarkupArchive::GetChildDataDateTimeSpan() const
{
	int d=0,h=0,m=0,s=0; 
	_stscanf(GetChildData(),_T("%d,%d:%d:%d"),&d,&h,&m,&s);
	return COleDateTimeSpan(d,h,m,s);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////::
/// FindGetData functions
///////////////////////////////////////////////////////////////////////////////////////////////////////::
bool CMarkupArchive::FindGetData(LPCTSTR szName, CString& _string)
{
	bool found;
	ResetPos();
	if  (found = FindElem(szName))
		_string = GetData();
	return found;
}

bool CMarkupArchive::FindGetData(LPCTSTR szName, bool& _bool)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
		_bool = GetDataBool();
	return found;
};

bool CMarkupArchive::FindGetData(LPCTSTR szName, int& _int)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
		_int = GetDataInt();
	return found;
};

bool CMarkupArchive::FindGetData(LPCTSTR szName, UINT& _UINT)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
		_UINT = GetDataUINT();
	return found;
};

bool CMarkupArchive::FindGetData(LPCTSTR szName, DWORD& _DWORD)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
		_DWORD = GetDataDWORD();
	return found;
};

bool CMarkupArchive::FindGetData(LPCTSTR szName, float& _float)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
		_float = GetDataFloat();
	return found;
};

bool CMarkupArchive::FindGetData(LPCTSTR szName, double& _double)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
		_double = GetDataDouble();
	return found;
};

bool CMarkupArchive::FindGetData(LPCTSTR szName, COleDateTime& _t)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
	{
		_t = GetDataDateTime();
	}
	return found;
};


bool CMarkupArchive::FindGetData(LPCTSTR szName, COleDateTimeSpan& _ts)
{
	bool found;

	ResetPos();
	if  (found = FindElem(szName))
	{
		_ts = GetDataDateTimeSpan();
	}
	return found;
};

#define MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( containerType , dataType )\
bool CMarkupArchive::FindGetData(LPCTSTR szName, std:: containerType < dataType >& _v)\
{ \
	bool found;\
	ResetPos();\
	if  (found = FindElem(szName))\
		GetDataEx(_v);\
	return found;\
};\
bool CMarkupArchive::FindGetChildData(LPCTSTR szName, std:: containerType < dataType >& _v)\
{\
	bool found;\
	ResetChildPos();\
	if  (found = FindChildElem(szName))\
		GetChildDataEx(_v);\
	return found;\
};

MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( vector, double)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( vector, float)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( vector, int)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( vector, BYTE)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( vector, short)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( vector, long)

MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( valarray, double)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( valarray, float)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( valarray, int)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( valarray, BYTE)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( valarray, short)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( valarray, long)

MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( list, double)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( list, float)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( list, int)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( list, BYTE)
MARKUPARCHIVE_IMPLEMENT_FINDGETDATA( list, UINT)

///////////////////////////////////////////////////////////////////////////////////////////////////////::
/// FindGetChildData functions
///////////////////////////////////////////////////////////////////////////////////////////////////////::
bool CMarkupArchive::FindGetChildData(LPCTSTR szName, CString& _string)
{
	bool found;
	ResetChildPos();
	if  (found = FindChildElem(szName))
		_string = GetChildData();
	return found;
}

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, bool& _bool)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
		_bool = GetChildDataBool();
	return found;
};

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, int& _int)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
		_int = GetChildDataInt();
	return found;
};

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, UINT& _UINT)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
		_UINT = GetChildDataUINT();
	return found;
};

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, long& _long)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
		_long = GetChildDataLong();
	return found;
};

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, DWORD& _DWORD)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
		_DWORD = GetChildDataDWORD();
	return found;
};

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, float& _float)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
		_float = GetChildDataFloat();
	return found;
};

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, double& _double)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
		_double = GetChildDataDouble();
	return found;
};

bool CMarkupArchive::FindGetChildData(LPCTSTR szName, COleDateTime& _t)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
	{
		_t = GetChildDataDateTime();
	}
	return found;
};

bool CMarkupArchive::SetNameSpace(LPCTSTR szNameSpace)	
{	
	m_sNameSpace = szNameSpace; 
	if (!m_sNameSpace.IsEmpty()) 
		m_sNameSpace+=_T(":"); 
	return true;
};
CString CMarkupArchive::GetNameSpace() const			
{	
	if (m_sNameSpace.IsEmpty())
		return m_sNameSpace;
	else
		return m_sNameSpace.Left(m_sNameSpace.GetLength()-1);
};


bool CMarkupArchive::FindGetChildData(LPCTSTR szName, COleDateTimeSpan& _ts)
{
	bool found;

	ResetChildPos();
	if  (found = FindChildElem(szName))
	{
		_ts = GetChildDataDateTimeSpan();
	}
	return found;
};

void CMarkupArchive::SetZipping( bool bEnable)
{
	if (bEnable)
		m_dwMode|=ArchiveModeZipped;
	else
		m_dwMode=~(~m_dwMode|ArchiveModeZipped);
}

bool CMarkupArchive::GetDataBool() const													{ return GetData() == _T("true"); };
int CMarkupArchive::GetDataInt() const														{ int val=0; _stscanf(GetData(),_T("%d"),&val); return  val; };
UINT CMarkupArchive::GetDataUINT() const													{ UINT val=0; _stscanf(GetData(),_T("%u"),&val); return  val; };
DWORD CMarkupArchive::GetDataDWORD() const													{ DWORD val=0; _stscanf(GetData(),_T("%u"),&val); return  val; };
float CMarkupArchive::GetDataFloat() const													{ float val=0; _stscanf(GetData(),_T("%f"),&val); return  val; };
double CMarkupArchive::GetDataDouble() const												{ double val=0; _stscanf(GetData(),_T("%lf"),&val); return  val; };
::COleDateTime CMarkupArchive::GetDataDateTime() const										{	COleDateTime t; t.ParseDateTime(GetData()); return t;};
void CMarkupArchive::GetDataEx(std::vector<double>& _v) const								{ TSTL2String<double>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::vector<float>& _v) const								{ TSTL2String<float>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::vector<int>& _v) const									{ TSTL2String<int>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::vector<BYTE>& _v) const									{ TSTL2String<BYTE>::ByteToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::vector<short>& _v) const								{ TSTL2String<short>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::vector<long>& _v) const									{ TSTL2String<long>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::valarray<double>& _v) const								{ TSTL2String<double>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::valarray<float>& _v) const								{ TSTL2String<float>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::valarray<int>& _v) const								{ TSTL2String<int>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::valarray<BYTE>& _v) const								{ TSTL2String<BYTE>::ByteToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::valarray<short>& _v) const								{ TSTL2String<short>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::valarray<long>& _v) const								{ TSTL2String<long>::ToSTL(GetData(), _v);};
void CMarkupArchive::GetDataEx(std::list<UINT>& _l) const									{ TSTL2String<UINT>::ToSTL(GetData(), _l);};
void CMarkupArchive::GetDataEx(std::list<double>& _l) const									{ TSTL2String<double>::ToSTL(GetData(), _l);};
void CMarkupArchive::GetDataEx(std::list<float>& _l) const									{ TSTL2String<float>::ToSTL(GetData(), _l);};
void CMarkupArchive::GetDataEx(std::list<int>& _l) const									{ TSTL2String<int>::ToSTL(GetData(), _l);};
void CMarkupArchive::GetDataEx(std::list<BYTE>& _l) const									{ TSTL2String<BYTE>::ByteToSTL(GetData(), _l);};

bool CMarkupArchive::GetChildDataBool() const												{ return GetChildData() == _T("true"); };
int CMarkupArchive::GetChildDataInt() const													{ int val=0; _stscanf(GetChildData(),_T("%d"),&val); return  val; };
long CMarkupArchive::GetChildDataLong() const												{ int val=0; _stscanf(GetChildData(),_T("%d"),&val); return  (long)val; };
UINT CMarkupArchive::GetChildDataUINT() const												{ UINT val=0; _stscanf(GetChildData(),_T("%u"),&val); return  val; };
DWORD CMarkupArchive::GetChildDataDWORD() const												{ DWORD val=0; _stscanf(GetChildData(),_T("%u"),&val); return  val; };
float CMarkupArchive::GetChildDataFloat() const												{ float val=0; _stscanf(GetChildData(),_T("%f"),&val); return  val; };
double CMarkupArchive::GetChildDataDouble() const											{ double val=0; _stscanf(GetChildData(),_T("%lf"),&val); return  val; };
::COleDateTime CMarkupArchive::GetChildDataDateTime() const									{	COleDateTime t; t.ParseDateTime(GetChildData()); return t;};
void CMarkupArchive::GetChildDataEx(std::vector<double>& _v) const							{ TSTL2String<double>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::vector<float>& _v) const							{ TSTL2String<float>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::vector<int>& _v) const								{ TSTL2String<int>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::vector<BYTE>& _v) const							{ TSTL2String<BYTE>::ByteToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::vector<short>& _v) const							{ TSTL2String<short>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::vector<long>& _v) const							{ TSTL2String<long>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::valarray<double>& _v) const						{ TSTL2String<double>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::valarray<float>& _v) const							{ TSTL2String<float>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::valarray<int>& _v) const							{ TSTL2String<int>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::valarray<BYTE>& _v) const							{ TSTL2String<BYTE>::ByteToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::valarray<short>& _v) const							{ TSTL2String<short>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::valarray<long>& _v) const							{ TSTL2String<long>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::list<UINT>& _l) const								{ TSTL2String<UINT>::ToSTL(GetChildData(),_l);};
void CMarkupArchive::GetChildDataEx(std::list<double>& _l) const							{ TSTL2String<double>::ToSTL(GetChildData(),_l);};
void CMarkupArchive::GetChildDataEx(std::list<float>& _l) const								{ TSTL2String<float>::ToSTL(GetChildData(),_l);};
void CMarkupArchive::GetChildDataEx(std::list<int>& _v) const								{ TSTL2String<int>::ToSTL(GetChildData(),_v);};
void CMarkupArchive::GetChildDataEx(std::list<BYTE>& _v) const								{ TSTL2String<BYTE>::ByteToSTL(GetChildData(),_v);};

bool CMarkupArchive::GetAttribBool(LPCTSTR szAttrib ) const									{ return GetAttrib(szAttrib) == _T("true"); };
int CMarkupArchive::GetAttribInt(LPCTSTR szAttrib ) const									{ int val=0; _stscanf(GetAttrib(szAttrib),_T("%d"),&val); return  val; };
UINT CMarkupArchive::GetAttribUINT(LPCTSTR szAttrib ) const									{ UINT val=0; _stscanf(GetAttrib(szAttrib),_T("%u"),&val); return  val; };
DWORD CMarkupArchive::GetAttribDWORD(LPCTSTR szAttrib ) const								{ DWORD val=0; _stscanf(GetAttrib(szAttrib),_T("%u"),&val); return  val; };
float CMarkupArchive::GetAttribFloat(LPCTSTR szAttrib ) const								{ float val=0; _stscanf(GetAttrib(szAttrib),_T("%f"),&val); return  val; };
double CMarkupArchive::GetAttribDouble(LPCTSTR szAttrib ) const								{ double val=0; _stscanf(GetAttrib(szAttrib),_T("%lf"),&val); return  val; };
COleDateTime CMarkupArchive::GetAttribDateTime(LPCTSTR szAttrib ) const						{ 	COleDateTime t; t.ParseDateTime(GetAttrib(szAttrib)); return t;};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::vector<double>& _v) const			{ TSTL2String<double>::ToSTL(GetAttrib(szAttrib),_v);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::vector<float>& _v) const			{ TSTL2String<float>::ToSTL(GetAttrib(szAttrib),_v);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::vector<int>& _v) const				{ TSTL2String<int>::ToSTL(GetAttrib(szAttrib),_v);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::vector<BYTE>& _v) const				{ TSTL2String<BYTE>::ByteToSTL(GetAttrib(szAttrib),_v);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::vector<short>& _v) const			{ TSTL2String<short>::ToSTL(GetAttrib(szAttrib),_v);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::vector<long>& _v) const				{ TSTL2String<long>::ToSTL(GetAttrib(szAttrib),_v);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::valarray<double>& _l) const			{ TSTL2String<double>::ToSTL(GetAttrib(szAttrib),_l);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::valarray<float>& _l) const			{ TSTL2String<float>::ToSTL(GetAttrib(szAttrib),_l);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::valarray<int>& _l) const			{ TSTL2String<int>::ToSTL(GetAttrib(szAttrib),_l);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::valarray<BYTE>& _l) const			{ TSTL2String<BYTE>::ByteToSTL(GetAttrib(szAttrib),_l);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::list<double>& _l) const				{ TSTL2String<double>::ToSTL(GetAttrib(szAttrib),_l);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::list<float>& _l) const				{ TSTL2String<float>::ToSTL(GetAttrib(szAttrib),_l);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::list<int>& _l) const				{ TSTL2String<int>::ToSTL(GetAttrib(szAttrib),_l);};
void CMarkupArchive::GetAttribEx(LPCTSTR szAttrib, std::list<BYTE>& _l) const				{ TSTL2String<BYTE>::ByteToSTL(GetAttrib(szAttrib),_l);};

bool CMarkupArchive::GetChildAttribBool(LPCTSTR szAttrib ) const							{ return GetChildAttrib(szAttrib) == _T("true"); };
int CMarkupArchive::GetChildAttribInt(LPCTSTR szAttrib ) const								{ int val=0; _stscanf(GetChildAttrib(szAttrib),_T("%d"),&val); return  val; };
UINT CMarkupArchive::GetChildAttribUINT(LPCTSTR szAttrib ) const							{ UINT val=0; _stscanf(GetChildAttrib(szAttrib),_T("%u"),&val); return  val; };
DWORD CMarkupArchive::GetChildAttribDWORD(LPCTSTR szAttrib ) const							{ DWORD val=0; _stscanf(GetChildAttrib(szAttrib),_T("%u"),&val); return  val; };
float CMarkupArchive::GetChildAttribFloat(LPCTSTR szAttrib ) const							{ float val=0; _stscanf(GetChildAttrib(szAttrib),_T("%f"),&val); return  val; };
double CMarkupArchive::GetChildAttribDouble(LPCTSTR szAttrib ) const						{ double val=0; _stscanf(GetChildAttrib(szAttrib),_T("%lf"),&val); return  val; };
COleDateTime CMarkupArchive::GetChildAttribDateTime(LPCTSTR szAttrib ) const				{ 	COleDateTime t; t.ParseDateTime(GetChildAttrib(szAttrib)); return t;};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::vector<double>& _v) const		{ TSTL2String<double>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::vector<float>& _v) const		{ TSTL2String<float>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::vector<int>& _v) const			{ TSTL2String<int>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::vector<BYTE>& _v) const		{ TSTL2String<BYTE>::ByteToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::vector<short>& _v) const		{ TSTL2String<short>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::vector<long>& _v) const		{ TSTL2String<long>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::valarray<double>& _v) const	{ TSTL2String<double>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::valarray<float>& _v) const		{ TSTL2String<float>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::valarray<int>& _v) const		{ TSTL2String<int>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::valarray<BYTE>& _v) const		{ TSTL2String<BYTE>::ByteToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::valarray<short>& _v) const		{ TSTL2String<short>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::valarray<long>& _v) const		{ TSTL2String<long>::ToSTL(GetChildAttrib(szAttrib),_v);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::list<double>& _l) const		{ TSTL2String<double>::ToSTL(GetChildAttrib(szAttrib),_l);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::list<float>& _l) const			{ TSTL2String<float>::ToSTL(GetChildAttrib(szAttrib),_l);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::list<int>& _l) const			{ TSTL2String<int>::ToSTL(GetChildAttrib(szAttrib),_l);};
void CMarkupArchive::GetChildAttribEx(LPCTSTR szAttrib, std::list<BYTE>& _l) const			{ TSTL2String<BYTE>::ByteToSTL(GetChildAttrib(szAttrib),_l);};	

bool CMarkupArchive::AddElemEx(LPCTSTR szName, const CString &str)							{	return AddElem(szName, str);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, LPCTSTR szString)					{	return AddElem(szName, szString);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, bool _bool )									{	return AddElem(szName, (_bool) ? _T("true"):_T("false"));};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, int _int )									{	m_sTemp.Format(_T("%d"),_int);		return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, UINT _UINT )									{	m_sTemp.Format(_T("%u"),_UINT);		return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, DWORD _DWORD )								{	m_sTemp.Format(_T("%u"),_DWORD);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, long _long )									{	m_sTemp.Format(_T("%d"),_long);		return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, float _float )								{	m_sTemp.Format(_T("%g"),_float);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, double _double )								{	m_sTemp.Format(_T("%g"),_double);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat)		{	return AddElem(szName,_t.Format(szFormat));};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const COleDateTimeSpan& _ts)					{	return AddElem(szName,_ts.Format(_T("%D,%H:%M:%S")));};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::vector<double>& _v )				{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::vector<float>& _v )				{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::vector<int>& _v )					{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::vector<BYTE>& _v )				{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::vector<short>& _v )				{	TSTL2String<short>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::vector<long>& _v )				{	TSTL2String<long>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::valarray<double>& _v )			{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::valarray<float>& _v )				{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::valarray<int>& _v )				{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::valarray<BYTE>& _v )				{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::valarray<short>& _v )				{	TSTL2String<short>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::valarray<long>& _v )				{	TSTL2String<long>::ToString(_v,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::list<UINT>& _l )					{	TSTL2String<UINT>::ToString(_l,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::list<double>& _l )				{	TSTL2String<double>::ToString(_l,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::list<float>& _l )					{	TSTL2String<float>::ToString(_l,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::list<int>& _l )					{	TSTL2String<int>::ToString(_l,m_sTemp);	return AddElem(szName,m_sTemp);};
bool CMarkupArchive::AddElemEx(LPCTSTR szName, const std::list<BYTE>& _l )					{	TSTL2String<BYTE>::ToString(_l,m_sTemp);	return AddElem(szName,m_sTemp);};

bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const CString &str)						{	return AddChildElem(szName, str);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, LPCTSTR szString)				{	return AddChildElem(szName, szString);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, bool _bool )							{	return AddChildElem(szName, (_bool) ? _T("true"):_T("false"));};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, int _int )								{	m_sTemp.Format(_T("%d"),_int);		return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, UINT _UINT )							{	m_sTemp.Format(_T("%u"),_UINT);		return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, DWORD _DWORD )							{	m_sTemp.Format(_T("%u"),_DWORD);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, long _long )							{	m_sTemp.Format(_T("%d"),_long);		return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, float _float )							{	m_sTemp.Format(_T("%g"),_float);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, double _double )						{	m_sTemp.Format(_T("%g"),_double);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat)		{	return AddChildElem(szName,_t.Format(szFormat));};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const COleDateTimeSpan& _ts)			{	return AddChildElem(szName,_ts.Format(_T("%D,%H:%M:%S")));};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::vector<double>& _v)			{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::vector<float>& _v)			{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::vector<int>& _v)				{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::vector<BYTE>& _v)			{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::vector<short>& _v)			{	TSTL2String<short>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::vector<long>& _v)			{	TSTL2String<long>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::valarray<double>& _v )		{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::valarray<float>& _v )		{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::valarray<int>& _v )			{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::valarray<BYTE>& _v )			{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::valarray<short>& _v )		{	TSTL2String<short>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::valarray<long>& _v )			{	TSTL2String<long>::ToString(_v,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::list<UINT>& _l)				{	TSTL2String<UINT>::ToString(_l,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::list<double>& _l)			{	TSTL2String<double>::ToString(_l,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::list<float>& _l)				{	TSTL2String<float>::ToString(_l,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::list<int>& _l)				{	TSTL2String<int>::ToString(_l,m_sTemp);	return AddChildElem(szName,m_sTemp);};
bool CMarkupArchive::AddChildElemEx(LPCTSTR szName, const std::list<BYTE>& _l)				{	TSTL2String<BYTE>::ToString(_l,m_sTemp);	return AddChildElem(szName,m_sTemp);};

bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const CString &str)							{	return AddAttrib(szName, str);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, LPCTSTR szString)					{	return AddAttrib(szName, szString);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, bool _bool )								{	return AddAttrib(szName, (_bool) ? _T("true"):_T("false"));};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, int _int )									{	m_sTemp.Format(_T("%d"),_int);			return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, UINT _UINT )								{	m_sTemp.Format(_T("%u"),_UINT);		return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, DWORD _DWORD )								{	m_sTemp.Format(_T("%u"),_DWORD);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, long _long )								{	m_sTemp.Format(_T("%d"),_long);		return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, float _float )								{	m_sTemp.Format(_T("%g"),_float);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, double _double )							{	m_sTemp.Format(_T("%g"),_double);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat)		{	return AddAttrib(szName,_t.Format(szFormat));};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const COleDateTimeSpan& _ts)				{	return AddAttrib(szName,_ts.Format(_T("%D,%H:%M:%S")));};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::vector<double>& _v )			{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::vector<float>& _v )				{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::vector<int>& _v )				{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::vector<BYTE>& _v )				{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::vector<short>& _v )				{	TSTL2String<short>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::vector<long>& _v )				{	TSTL2String<long>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::valarray<double>& _v )			{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::valarray<float>& _v )			{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::valarray<int>& _v )				{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::valarray<BYTE>& _v )			{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::list<UINT>& _l )				{	TSTL2String<UINT>::ToString(_l,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::list<double>& _l )				{	TSTL2String<double>::ToString(_l,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::list<float>& _l )				{	TSTL2String<float>::ToString(_l,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::list<int>& _l )					{	TSTL2String<int>::ToString(_l,m_sTemp);	return AddAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddAttribEx(LPCTSTR szName, const std::list<BYTE>& _l )				{	TSTL2String<BYTE>::ToString(_l,m_sTemp);	return AddAttrib(szName,m_sTemp);};

bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const CString &str)					{	return AddChildAttrib(szName, str);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, LPCTSTR szString)			{	return AddChildAttrib(szName, szString);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, bool _bool )							{	return AddChildAttrib(szName, (_bool) ? _T("true"):_T("false"));};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, int _int )							{	m_sTemp.Format(_T("%d"),_int);		return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, UINT _UINT )							{	m_sTemp.Format(_T("%u"),_UINT);		return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, DWORD _DWORD )						{	m_sTemp.Format(_T("%u"),_DWORD);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, long _long )							{	m_sTemp.Format(_T("%d"),_long);		return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, float _float )						{	m_sTemp.Format(_T("%g"),_float);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, double _double )						{	m_sTemp.Format(_T("%g"),_double);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const COleDateTime& _t, LPCTSTR szFormat)		{	return AddChildAttrib(szName,_t.Format(szFormat));};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const COleDateTimeSpan& _ts)			{	return AddChildAttrib(szName,_ts.Format(_T("%D,%H:%M:%S")));};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::vector<double>& _v )		{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::vector<float>& _v )		{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::vector<int>& _v )			{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::vector<BYTE>& _v )			{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::vector<short>& _v )		{	TSTL2String<short>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::vector<long>& _v )			{	TSTL2String<long>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::valarray<double>& _v )		{	TSTL2String<double>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::valarray<float>& _v )		{	TSTL2String<float>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::valarray<int>& _v )		{	TSTL2String<int>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::valarray<BYTE>& _v )		{	TSTL2String<BYTE>::ToString(_v,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::list<UINT>& _l )			{	TSTL2String<UINT>::ToString(_l,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::list<double>& _l )			{	TSTL2String<double>::ToString(_l,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::list<float>& _l )			{	TSTL2String<float>::ToString(_l,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::list<int>& _l )			{	TSTL2String<int>::ToString(_l,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};
bool CMarkupArchive::AddChildAttribEx(LPCTSTR szName, const std::list<BYTE>& _l )			{	TSTL2String<BYTE>::ToString(_l,m_sTemp);	return AddChildAttrib(szName,m_sTemp);};

};
